package com.jd.basic.listener;

import com.jd.sys.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener // 申明自定义web监听器，被容器注册使用
public class PermissionScanInitListener implements ServletContextListener {
    @Autowired
    private IPermissionService iPermissionService;
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        iPermissionService.scanPermission();
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {

    }
}
